InputDialog
Text$ = InputDialog(Title$, Prompt$, [InitialText$], [ShowAsPassword])
 
Parameters:

    Title$=the title of the dialog
    Prompt$=the message above the input field
    [InitialText$]=the initially shown text in the input field
    [ShowAsPassword]= if set to 1 the text will be displayed as a password
Returns:

    Text$ = the text the user has entered or a null string if the dialog was cancelled
 

     InputDialog pops a windows input query dialog. The dialog allows the user to enter a row of text. It could be used to ask the player their name, age etc.

Title$ = the text of the title bar
Propmt$ = the message that will be displayed above the input field
InitialText$ = the initial text in the input field
ShowAsPassword = if this parameter is set to 1, the text that the user enters will not be displayed as clear text but each character entered will show up as a dot. This is usually used for entering passwords. The parameter is optional and defaults to 0.



FACTS:


      * InputDialog is not asynchronous, so the PlayBasic application will halt while the dialog is open.




  
; Include the Dialogs library in this program
  #Include "PBDialogs"
  
; Clear the Screen to Blue
  Cls RGB(0,0,255)
  
; Init the dialogs TItle and heading message
  Title$="Play Dialog Input Query Box"
  Text$="Enter A New Name"
  
  
; Call the Dialog Function.  This box will
; have a YES & NO option for the users
  Name$=InputDialog(Title$,Text$, "")
  
; Check if the USER clicked the cancel button
; while using this dialog ? - If they didn't cancel
; then whatever they entered we accept
  If Name$ <> ""
     
   ;
     Print "You Selected To Change Names To"
     Print Name$
     
  Else
     Print "You Selected to Cancel This input query"
     
  EndIf
  
  
  Sync
  WaitKey
  




This example would output.

  
  
  

 
Related Info: :
 


(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com